import Quick from ".";
import { WeaInput, WeaLocaleProvider } from 'ecCom';
const { getLabel } = WeaLocaleProvider;

export default class Main extends Quick {
    state = {
        detailMark: '',
        jsonParam: ''
    }
    getComponent = () => {
        const { fieldMark, jsonParam } = this.state;
        return [
            <div>
                <WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@u7kf5b@fieldMark`}
                    style={{ width: 200 }}
                    placeholder={getLabel('528639','请输入字段名称')}
                    value={fieldMark}
                    onChange={v => this.setState({ fieldMark: v })}
                />
            </div>,
            <div style={{marginTop:8}}>
                <WeaInput ecId={`${this && this.props && this.props.ecId || ''}_WeaInput@7aurup@jsonParam`}
                    style={{ width: 200 }}
                    placeholder={getLabel('528640','请输入新增参数值') }
                    value={jsonParam}
                    onChange={v => this.setState({ jsonParam: v })}
                />
            </div>
        ]
    }
    getTitle = () => {
        return 'excel.appendBrowserDataUrlParam';
    }
    getScript = () => {
        return `excel.appendBrowserDataUrlParam('${this.state.fieldMark}',${this.state.jsonParam});`
    }
}